package com.qzboot.backend.web.module.sys;

import com.qzboot.facade.entity.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

/**
 * @author x
 * @date 2018/9/14 9:49
 */
public class BaseSysController {


    protected SysUser getUser() {
        return (SysUser) SecurityUtils.getSubject().getPrincipal();
    }

    protected Long getUserId() {
        return getUser().getId();
    }

    protected Subject getSubject() {
        return SecurityUtils.getSubject();
    }

    protected Session getSession() {
        return SecurityUtils.getSubject().getSession();
    }

}
